package com.ssfeng.youxia.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Callable;

/**
 * Created by liyuhang on 2020-05-30.
 */
@RestController
@RequestMapping(value = "/async")
public class AsyncController {

    @GetMapping("/test")
    public Callable<String> test(){

        return new Callable<String>() {
            @Override
            public String call() throws Exception {
                Thread.sleep(1000*10l);
                return "from test1";
            }
        };
    }
}
